<!--地图控件动态回归组件 相关自定义属性后续自行增加-->
<template>
  <template v-if="componentLists">
    <component
      v-for="componentItem in componentLists"
      :key="componentItem.name"
      :is="componentItem.name"
      v-show="componentItem.visible"
      :visible="componentItem.visible"
      :mapStyle="componentItem.mapStyle"
      :class="componentItem.class"
      @[componentItem.event.funType]="
        parseFun(componentItem.event.funName, 'dynamic', $event)
      "
    >
      <template v-if="componentItem.childrenContainer">
        <dynamic-recursive-component
          :componentLists="componentItem.childrenContainer"
          @parseFun="parseFun"
        />
      </template>
    </component>
  </template>
</template>

<script>
import { AimOutlined } from '@ant-design/icons-vue';
export default {
  emits: ['parseFun'],
  name: 'dynamicRecursiveComponent',
  props: ['componentLists'],
  data() {
    return {
      mapStyleComponent: '',
    };
  },
  components: {
    AimOutlined,
  },
  methods: {
    parseFun(funName, type, e) {
      this.$emit('parseFun', { funName, type, e });
    },
  },
};
</script>
<style lang="less" scoped>
.getLocation {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 35px;
  height: 35px;
  text-align: center;
  line-height: 44px;
  background: white;
  border-radius: 50%;
  .locationIcon {
    font-size: 25px;
    color: #a39292;
  }
  .locationIcon:hover {
    cursor: pointer;
  }
}
</style>
